home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-12 | 4.3 KB | 144 lines | [TEXT/GEOL] |
- Item 9099509 12-Oct-89 10:46
-
- From: MUYSVASOVIC1 ER&D - J-D Muys-Vasovic
-
- To: MACAPP.TEST MacApp SQA Team
- MACAPP.TECH$ MACAPP Tech
- APPLE.BUGS Apple Bugs Reporting
- MACDTS Macintosh Developer Tech. Supt.
-
- Sub: MABuild "bug"
-
- I think I found a "feature" of MABuild which I would call a bug.
- In short, MABuild's "-d" option doesn't work. Here are the details:
-
- I have a compile-time variable called qSA, which allows me to build two
- different versions of my MacApp application depending on its value (it is
- boolean: qSA can be seen as either true or false). So, I would like to type
- something as:
-
- MABuild myApp -d qSA
- or
- MABuild myApp
-
- Of course I realized pretty soon that Pascal, and MABuild for that matter needs
- either "-d qSA=TRUE" or "-d qSA=FALSE", leading to :
-
- MABuild myApp -d qSA=TRUE
- or
- MABuild myApp -d qSA=FALSE
-
- Everything would work OK weren't my myAppl.a assembly file: the problem is that
- asm doesn't allow "-d qSA=TRUE" style options. Asm needs "-d qSA=<number>". So
- I imagined:
-
- MABuild myApp -d qSA=1
- or
- MABuild myApp -d qSA=0
-
- Which doesn't work either because of Pascal. I was stuck. Then I wondered how
- qDebug... were handled, and I looked at MABuild soure code. Here is the
- corresponding excerpt:
-
- { Debugging support }
- IF fDebug THEN
- BEGIN
- fOptionFlags.Catenate('Db');
-
- fAsmOptions.Catenate(' -d qDebug=1');
- fCOptions.Catenate(' -d qDebug=TRUE');
- fCPlusOptions.Catenate(' -d qDebug=TRUE');
- fMakeOptions.Catenate(' -d qDebug=TRUE');
- fPascalOptions.Catenate(' -d qDebug=TRUE');
- fRezOptions.Catenate(' -d qDebug=TRUE -d Debugging');
- END
- ELSE
- BEGIN
- fAsmOptions.Catenate(' -d qDebug=0');
- fCOptions.Catenate(' -d qDebug=FALSE');
- fCPlusOptions.Catenate(' -d qDebug=FALSE');
- fMakeOptions.Catenate(' -d DebugFiles= -d DebugRsrcs= -d DebugLib= -d
- qDebug=FALSE');{ Eliminate debug files as targets in the makefiles }
- fPascalOptions.Catenate(' -d qDebug=FALSE');
- fRezOptions.Catenate(' -d qDebug=FALSE');
- END;
-
- You can see that asm is special cased. Now here is the "-d" option treatment:
-
- kwd:
- BEGIN
- theNextArg := GetNextArg;
-
- fAsmOptions.Catenate(' -d ');
- fAsmOptions.Catenate(theNextArg);
-
- fCOptions.Catenate(' -d ');
- fCOptions.Catenate(theNextArg);
-
- fCPlusOptions.Catenate(' -d ');
- fCPlusOptions.Catenate(theNextArg);
-
- fMakeOptions.Catenate(' -d ');
- fMakeOptions.Catenate(theNextArg);
-
- fPascalOptions.Catenate(' -d ');
- fPascalOptions.Catenate(theNextArg);
-
- fRezOptions.Catenate(' -d ');
- fRezOptions.Catenate(theNextArg);
-
- END;
-
- You can see that the option is passed straight thru to all the tools.
- Given that MABuild help describe the option as:
-
- -d name=(TRUE|FALSE) # set compile time variable name in all compilers
-
- MABuild should transform "-d qSA=TRUE" into "-d qSA=1", and "-d qSA=FALSE" into
- "-d qSA=0". Of course the higher level problem lies in the inconsistency
- between the MPW tools. Asm should accept "-d qSA=TRUE" and "-d qSA=FALSE".
-
- However, there is a simple fix to the problem which doesn't require changing
- MABuild source code. Only change the default asm option in startup from:
-
- -Asm '-case on' ∂
-
- -Asm '-case on -d FALSE=0 -d TRUE=1' ∂
-
- In the same bandwagon, another small inconsistency: in the startup file, the
- default are set as:
-
- SET MABuildDefaults ∂
- "-p ∂
- -Asm '-case on' ∂
- -Debug ∂
- -Make -w ∂
- -Rez -rd ∂
- -Link -srt ∂
- -CPlus '-d SHRT_MAX=32767 -d FALSE=0 -d TRUE=1' ∂
- -RenameFlag NmDbInUnPeRaTrTe 'Debug Files' ∂
- -RenameFlag S6Cq20FpNmDbInUnPeRaTrTe 'Debug /MacII+Sys6+' ∂
- -RenameFlag Te 'Non-Debug Files' ∂
- -RenameFlag InTe 'Non-Debug /Inspector' ∂
- -RenameFlag S6Cq20FpTe 'Non-Debug /MacII+Sys6+' ∂
- ∂
- -RenameFlag NmDbInUnPeRaTrTeSm 'SADE Debug Files' ∂
- -RenameFlag S6Cq20FpNmDbInUnPeRaTrTeSm 'SADE Debug /MacII+Sys6+' ∂
- -RenameFlag TeSm 'SADE Non-Debug Files' ∂
- -RenameFlag S6Cq20FpTeSm 'SADE Non-Debug /MacII+Sys6+' ∂
- -RenameFlag InTeSm 'SADE Non-Debug /Inspector'"
- EXPORT MABuildDefaults
-
-
- The problem is that there are no C options. I suggest to add the line:
-
- -C '-d SHRT_MAX=32767 -d FALSE=0 -d TRUE=1' ∂
-
-
- BTW, my config: MacApp 2.0B9, MPW 3.1B1.
-
- Regards.
-
- Jean-Denis Muys-Vasovic.
-
-